﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShoppingCar.aspx.cs" Inherits="Maticsoft.Web.wap.ShoppingCar" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <!--#include file="include/head.htm"-->
    <script type="text/javascript">
        function Settlement() {
            var ids = "";
            $("#list :checked").each(function () {
                if (ids != "") {
                    ids += ",";
                }
                ids += $(this).attr("id");
            })
            if ($("#list :checked").length > 0) {
                window.location.href = "Settlement.aspx?ids=" + ids;
            }
            else {
                alert("请选择商品");
            }
        }

        function SelAll(obj) {
            if ($(obj).prop("checked") || $(obj).prop("checked") == "checked") {
                $("#list :checkbox").each(function () {
                    $(this).prop("checked", "checked");
                })
            }
            else {
                $("#list :checkbox").each(function () {
                    $(this).prop("checked", "");
                })
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <header class="mui-bar">
			<a class="mui-action-back gotoup mui-pull-left"></a>
			<h1 class="mui-title">购物车</h1>
			<!--<a class="mui-pull-right tc-black">编辑</a>-->
		</header>
    <div class="mui-content">
        <ul class="mui-table-view" style="margin-top: 0;" id="list">
            <asp:Repeater ID="Repeater1" runat="server">
            <ItemTemplate>
            <li class="mui-table-view-cell mui-checkbox mui-left shop-car">
                <input type="checkbox" id="<%#Eval("ProductId") %>" checked="checked" />
                <div class="mui-media">
                    <img src="/uploadpic/<%#Eval("pic") %>" class="mui-media-object">
                    <div class="mui-media-body">
                        <h5 class="mui-ellipsis-2 tc-black" style="margin-top: 0;">
                            <%#Eval("ProductName") %></h5>
                        <h6 class="mui-ellipsis tc-lgray">
                            规格：<%#Eval("ProductDesc")%></h6>
                        <div class="mui-row">
                            <h4 class="tc-red mui-pull-left" style="margin: 0;">
                                <%#Maticsoft.Common.DigitHelper.GetDecimal(Eval("SalePrice")) %></h4>
                            <h6 class="tc-lgray mui-pull-right">
                                <%#Eval("ProductNum") %></h6>
                        </div>
                    </div>
                </div>
            </li>
            </ItemTemplate>
            </asp:Repeater>
        </ul>
        <div class="fix-btm-0 bg-white">
            <div class="mui-checkbox mui-left">
                <input type="checkbox" style="left: 10px" onclick="SelAll(this);" />
                <div class="mui-media" style="padding-left: 40px;">
                    <h5 class="tc-black mui-pull-left" style="padding-right: 10px; line-height: 32px;">
                        选择</h5>
                        <h5 class="tc-black mui-pull-left" style="line-height: 32px;">
                            合计：<span class="tc-red" id="totalMoney" runat="server"></span></h5>
                        <h6 class="tc-lgray mui-pull-left" style="line-height: 32px;">
                            不含运费</h6>
                        <button style="width: 30%; float: right; border-radius: 0;" type="button" onclick="Settlement();">
                            <h5 class="tc-white mui-pull-left">
                                去结算</h5>
                            <h6 class="tc-white mui-pull-left" id="productNum" runat="server">
                                </h6>
                        </button>
                </div>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
